home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 April / PCWorld_2008-04_cd.bin / komercni software / miton / SystemMechanic7Pro.exe / {app} / smhtml.dll / 1033 / HTML / INTERNETSECURITY.JS < prev    next >
Text File  |  2008-01-24  |  10KB  |  389 lines

  1.  
  2.  
  3.  
  4. function InternetSecurityPageOnLoad()
  5. {
  6.     SetAntivirusLaunchButtonCaption(btLOC_LaunchAV);
  7.     SetFirewallLaunchButtonCaption(btLOC_LaunchFW);
  8.     SetAntivirusMoreInfoButtonCaption(btLOC_IS_MoreInfo);
  9.     SetFirewallMoreInfoButtonCaption(btLOC_IS_MoreInfo);
  10. }
  11.  
  12. // Call it when page load
  13. AddLoadEvent(InternetSecurityPageOnLoad);
  14.  
  15.  
  16.  
  17. //*************** internet security  UI *********************************//
  18.  
  19. var IS_Red = "0";
  20. var IS_Yellow = "1";
  21. var ID_Green = "2";
  22.  
  23. var AV_MoreInfo_ID = -1;
  24. var FW_MoreInfo_ID = -1;
  25.  
  26. function SetAntivirusLaunchButtonCaption(Value)
  27. {
  28.    var b = new ActionButton()
  29.     b.ID = "btnAvLaunch";
  30.     b.Type = ACTION_BUTTON_CUSTOM;
  31.     b.Text = Value ; 
  32.     b.Event = "external.DoOnAVLaunchButtonClick();";
  33.     b.Class = "button";
  34.     b.Width = btLOC_LaunchAV_width;
  35.     b.FloatClass = "floatR";
  36.     Get('spAvLaunch').innerHTML  =  b.Render();
  37. }
  38.  
  39. function SetAntivirusMoreInfoButtonCaption(Value)
  40. {
  41.    var b = new ActionButton()
  42.     b.ID = "btnAvMoreinfo";
  43.     b.Type = ACTION_BUTTON_CUSTOM;
  44.     b.Text = Value;//"More Info";
  45.     b.Event = "external.DoOnAVMoreInfoButtonClick(AV_MoreInfo_ID);";
  46.     b.Class = "button";
  47.     //b.Width = 145;
  48.     b.FloatClass = "floatR";
  49.     Get('spAvMoreInfo').innerHTML  =  b.Render();
  50. }
  51.  
  52.  
  53.  
  54. function SetFirewallLaunchButtonCaption(Value)
  55. {
  56.   var b = new ActionButton()
  57.     b.ID = "btnFwLaunch";
  58.     b.Type = ACTION_BUTTON_CUSTOM;
  59.     b.Text = Value; 
  60.     b.Event = "external.DoOnFWLaunchButtonClick();";
  61.     b.Class = "button";
  62.     b.Width = btLOC_LaunchFW_width;
  63.     b.FloatClass = "floatR";
  64.     Get('spFwLaunch').innerHTML  =  b.Render();
  65. }
  66.  
  67. function SetFirewallMoreInfoButtonCaption(Value)
  68. {
  69.    var b = new ActionButton()
  70.     b.ID = "btnFwMoreinfo";
  71.     b.Type = ACTION_BUTTON_CUSTOM;
  72.     b.Text = Value;//"More Info";
  73.     b.Event = "external.DoOnFWMoreInfoButtonClick(FW_MoreInfo_ID);";
  74. //    b.Event = "alert(  FW_MoreInfo_ID );";
  75.     
  76.     b.Class = "button";
  77.     //b.Width = 145;
  78.     b.FloatClass = "floatR";
  79.     Get('spFwMoreInfo').innerHTML  =  b.Render();
  80.  
  81. }
  82.  
  83.  
  84.  
  85. function SetAntivirusStatus(State)
  86. {
  87.   switch(State)
  88.   {
  89.     case IS_Red:
  90.       SetClass("spAVTitle", "IS_status_txt red");
  91.       Get("imgAV").src = "IS_icon_critical.gif";
  92.       break;
  93.     case IS_Yellow:
  94.       SetClass("spAVTitle", "IS_status_txt yellow");
  95.       Get("imgAV").src = "IS_icon_fair.gif";
  96.       break;
  97.     case ID_Green:
  98.       SetClass("spAVTitle", "IS_status_txt green");
  99.       Get("imgAV").src = "IS_icon_good.gif";
  100.       break;
  101.   }
  102. }
  103.  
  104. function SetFirewallStatus(State)
  105. {
  106.   switch(State)
  107.   {
  108.     case IS_Red:
  109.       SetClass("spFWTitle", "IS_status_txt red");
  110.       Get("imgFW").src = "IS_icon_critical.gif";
  111.       break;
  112.     case IS_Yellow:
  113.       SetClass("spFWTitle", "IS_status_txt yellow");
  114.       Get("imgFW").src = "IS_icon_fair.gif";
  115.       break;
  116.     case ID_Green:
  117.       SetClass("spFWTitle", "IS_status_txt green");
  118.       Get("imgFW").src = "IS_icon_good.gif";
  119.       break;
  120.   }
  121. }
  122.  
  123. function SetAntivirusMoreInfoButtonID(Value)
  124. {
  125.   AV_MoreInfo_ID = Value;
  126. }
  127. function SetFirewallMoreInfoButtonID(Value)
  128. {
  129.   FW_MoreInfo_ID = Value;
  130. }
  131.  
  132. function SetAntivirusText(Header, Details)
  133. {
  134.   Get("spAVHeading").innerHTML = Header;
  135.   Get("spAVDetails").innerHTML = Details;
  136. }
  137. function SetFirewallText(Header, Details)
  138. {
  139.   Get("spFWHeading").innerHTML = Header;
  140.   Get("spFWDetails").innerHTML = Details;
  141. }
  142.  
  143. //Value: Boolean
  144. function SetAntivirusLaunchButtonVisible(Value)
  145. {
  146.   SetDisplayWidget('spAvLaunch', Value);
  147. }
  148. //Value: Boolean
  149. function SetFirewallLaunchButtonVisible(Value)
  150. {
  151.   SetDisplayWidget('spFwLaunch', Value);
  152. }
  153.  
  154.  
  155. //Value: Boolean
  156. function SetAntivirusMoreInfoButtonVisible(Value)
  157. {
  158.   SetDisplayWidget('spAvMoreInfo', Value);  
  159. }
  160. //Value: Boolean
  161. function SetFirewallMoreInfoButtonVisible(Value)
  162. {
  163.   SetDisplayWidget('spFwMoreInfo', Value);  
  164. }
  165.  
  166. //Value: Boolean
  167. function SetAntivirusMoreInfoTextVisible(Value)
  168. {
  169.    SetDisplayWidget('spAVMoreInfoText', Value);  
  170. }
  171. //Value: Boolean
  172. function SetFirewallMoreInfoTextVisible(Value)
  173. {
  174.    SetDisplayWidget('spFWMoreInfoText', Value);  
  175. }
  176.  
  177. function SetAntivirusMoreInfoText(Text)
  178. {
  179.   Get("spAVMoreInfoText").innerHTML = URLDecode(Text);
  180. }
  181. function SetFirewallMoreInfoText(Text)
  182. {
  183.   Get("spFWMoreInfoText").innerHTML = URLDecode(Text);
  184. }
  185.  
  186. //Value: Boolean
  187. function SetAntivirusOptionsVisible(Value)
  188. {
  189.    SetDisplayWidget('divAVOptionsTable', Value);  
  190. }
  191. //Value: Boolean
  192. function SetFirewallOptionsVisible(Value)
  193. {
  194.    SetDisplayWidget('divFWOptionsTable', Value);  
  195. }
  196.  
  197. function AddAntivirusOptionRow(RowID, Column1,Column2)
  198. {
  199.   var t = new DataTable();
  200.   t.ID = "tblAVOptions";
  201.   t.Class = "tb_antivirus_details";
  202.   t.Width = "100%";
  203.   var col1 = "<div >" + URLDecode(Column1) + "</div>";
  204.   t.AddWithKey(RowID, col1, URLDecode(Column2));
  205.   if( Get( t._ClientID() ) == null )
  206.      Get("divAVOptionsTable").innerHTML += t.Render();
  207. }
  208. function AddFirewallOptionRow(RowID, Column1,  Column2)
  209. {
  210.   var t = new DataTable();
  211.   t.ID = "tblFWOptions";
  212.   t.Class = "tb_antivirus_details";
  213.   t.Width = "100%";
  214.   var col1 = "<div >" + URLDecode(Column1) + "</div>";
  215.   t.AddWithKey(RowID, col1, URLDecode(Column2));
  216.   if( Get( t._ClientID() ) == null )
  217.      Get("divFWOptionsTable").innerHTML += t.Render();
  218. }
  219.  
  220. function EditAntivirusOptionRow(RowID, Column1,  Column2)
  221. {
  222.   var t = new DataTable();
  223.   t.ID = "tblAVOptions";
  224.    var col1 = "<div  >" + URLDecode(Column1) + "</div>";
  225.   t.ChangeCellbyKey( col1 , RowID, 0);
  226.   t.ChangeCellbyKey( URLDecode(Column2) , RowID, 1);
  227.   
  228. }
  229. function EditFirewallOptionRow(RowID, Column1,  Column2 )
  230. {
  231.   var t = new DataTable();
  232.   t.ID = "tblFWOptions";
  233.    var col1 = "<div  >" + URLDecode(Column1) + "</div>";
  234.   t.ChangeCellbyKey( col1 , RowID, 0);
  235.   t.ChangeCellbyKey( URLDecode(Column2) , RowID, 1);
  236. }
  237.  
  238.  
  239. // Value : bool
  240. function SetAntivirusSectionBusy(Value)
  241. {
  242.   SetDisplayWidget('divAvTables', !Value);
  243.   SetDisplayWidget('tblAvLoading', Value);
  244. }
  245.  
  246. // Value : bool
  247. function SetFirewallSectionBusy(Value)
  248. {
  249.    SetDisplayWidget('divFwTables', !Value);
  250.   SetDisplayWidget('tblFwLoading', Value);
  251. }
  252.  
  253.  
  254. // Value : bool
  255. function SetAntivirusSectionAnalyzing(Value)
  256. {
  257.   SetDisplayWidget('trAVData', !Value);
  258.   //SetDisplayWidget('divAVData', !Value);
  259.   
  260.   SetDisplayWidget('divAVLoading', Value);
  261. }
  262.  
  263. // Value : bool
  264. function SetFirewallSectionAnalyzing(Value)
  265. {
  266.   SetDisplayWidget('trFWData', !Value);
  267.   SetDisplayWidget('divFWLoading', Value);
  268. }
  269.  
  270. // Value : bool
  271. function SetAntivirusVerifyingVisible(Value)
  272. {
  273.   SetDisplayWidget('trAVVerify', Value);
  274. }
  275. // Value : bool
  276. function SetFirewallVerifyingVisible(Value)
  277. {
  278.   SetDisplayWidget('trFWVerify', Value);
  279. }
  280.  
  281. //*************** end internet security *********************************//
  282.  
  283.  
  284.  
  285. //***************  test functions *********************************//
  286.  
  287.  
  288. function i1()
  289. {
  290.  SetAntivirusText("Header", "Details");
  291.  SetAntivirusMoreInfoText("more infor text");
  292.  
  293.  
  294.  SetAntivirusLaunchButtonVisible(false);
  295.  SetAntivirusMoreInfoButtonVisible(true);
  296. SetAntivirusMoreInfoTextVisible(false)
  297. SetAntivirusMoreInfoButtonVisible(true);
  298. // 
  299. SetAntivirusOptionsVisible(true);
  300. SetFirewallOptionsVisible(true);
  301.  
  302.  AddAntivirusOptionRow("s", "Last full system scan: <span class=\"bold red\">7/10/2007 (30 days ago)</span>", "sdfsdfsdf");
  303.  AddAntivirusOptionRow("s1", "sdf","Xsdfsdfsdf");
  304.  AddFirewallOptionRow("f", "Last full system scan: <span class=\"bold red\">7/10/2007 (30 days ago)</span>", "sdfsdfsdf");
  305.  AddFirewallOptionRow("f1", "sdf","Xsdfsdfsdf");
  306.  
  307.  
  308. // AddAntivirusOptionRow("s2", "sdf","Xdfsdfsdf");
  309. // 
  310.   SetFirewallText("Header", "Details");
  311.  SetFirewallLaunchButtonVisible(false);
  312.  SetFirewallMoreInfoButtonVisible(true);
  313. SetFirewallMoreInfoTextVisible(false)
  314. // 
  315. // AddFirewallOptionRow("s", "Last full system scan:<span class=\"bold red\">7/10/2007 (30 days ago)</span>", "sdfsdfsdf");
  316. // AddFirewallOptionRow("s1", "sdf","Ssdfsdfsdf");
  317. // AddFirewallOptionRow("s2", "sdf","Ssdfsdfsdf");
  318. SetFirewallStatus("0");
  319. // 
  320. SetAntivirusSectionBusy(false);
  321. SetFirewallSectionBusy(false);
  322. SetAntivirusVerifyingVisible(true);
  323. SetFirewallVerifyingVisible(true);
  324. }
  325.  
  326. function i2()
  327. {
  328. SetFirewallMoreInfoButtonID(2323);
  329.  //SetAntivirusLaunchButtonVisible(true);
  330.  //SetAntivirusMoreInfoButtonVisible(false);
  331.  SetAntivirusMoreInfoTextVisible(true)
  332.  SetAntivirusMoreInfoText("Lorem ipsum dolor bsadfasd asdm ipsum dolor.");
  333.  
  334.  EditAntivirusOptionRow("s", "XXXXX", "XXXYYYYYYYY");
  335.  EditAntivirusOptionRow("s1", "Last full system scan: <span class=\"bold red\">7/10/2007 (30 days ago)</span>", "2222");
  336.  EditFirewallOptionRow("f", "XXXXX", "XXXYYYYYYYY");
  337.  EditFirewallOptionRow("f1", "Last full system scan: <span class=\"bold red\">7/10/2007 (30 days ago)</span>", "2222");
  338.  
  339.  //SetAntivirusOptionsVisible(true);
  340.  
  341.  //SetFirewallLaunchButtonVisible(true);
  342.  //SetFirewallMoreInfoButtonVisible(false);
  343.  SetFirewallMoreInfoTextVisible(true)
  344.  SetFirewallMoreInfoText("Lorem ipsum dolor bsadfasd asdm ipsum dolor.");
  345.  
  346.  EditFirewallOptionRow("s1", "XXXXX", "CCYYYYYYY");
  347.  EditFirewallOptionRow("s2", "Last full system scan: <span class=\"bold red\">7/10/2007 (30 days ago)</span>", "2222");
  348.  
  349.  SetFirewallStatus("1");
  350.  
  351.  SetAntivirusSectionBusy(true);
  352.  SetFirewallSectionBusy(true);
  353. SetAntivirusVerifyingVisible(false);
  354. SetFirewallVerifyingVisible(false);
  355. }
  356.  
  357. function i3()
  358. {
  359.  SetFirewallStatus("0");
  360.  
  361.  SetAntivirusOptionsVisible(false);
  362. SetFirewallOptionsVisible(false);
  363.  
  364. SetFirewallSectionAnalyzing(false);
  365. SetAntivirusSectionAnalyzing(false);
  366.  
  367.  
  368. }
  369.  
  370. function i4()
  371. {
  372. SetFirewallSectionAnalyzing(true);
  373. SetAntivirusSectionAnalyzing(true);
  374. }
  375.  
  376.  
  377. //***********************************Set Language*************************//
  378. function SetLanguage (language)
  379. {
  380.      Get("spLOC_AntiVirus").innerHTML = spLOC_AntiVirus;
  381.      Get("spLOC_AVConfirmMsg").innerHTML = spLOC_AVConfirmMsg;
  382.      Get("pLOC_LoadingAV").innerHTML = pLOC_LoadingAV;
  383.      Get("pLOC_LoadingAVDetails").innerHTML=pLOC_LoadingAVDetails;
  384.      Get("spLOC_FWConfirmMsg").innerHTML = spLOC_FWConfirmMsg;
  385.      Get("spLOC_FireWall").innerHTML = spLOC_FireWall;
  386.       Get("pLOC_LoadingFW").innerHTML = pLOC_LoadingFW;
  387.      Get("pLOC_LoadingFWDetails").innerHTML=pLOC_LoadingFWDetails;
  388. }
  389.